Imports System
Imports System.Data
Imports System.Data.Common
Imports System.Collections.Generic
Imports ACFramework

<Serializable()> _
Public Class ACETipoEntidad

#Region " Campos "
   Private m_tipe_codigo As String
   Private m_tipe_desc As String
   Private m_nuevo As Boolean
   Private m_modificado As Boolean
   Private m_eliminado As Boolean
#End Region

#Region " Constructores "
   Public Sub New()

   End Sub

   Public Sub New(ByVal x_tipe_codigo As String, ByVal x_tipe_desc As String)
      m_tipe_codigo = x_tipe_codigo
      m_tipe_desc = x_tipe_desc
   End Sub
#End Region

#Region " Propiedades "
   Public Property TIPE_Codigo() As String
      Get
         Return m_tipe_codigo
      End Get
      Set(ByVal value As String)
         If Not IsNothing(m_tipe_codigo) Then
            If Not m_tipe_codigo.Equals(value) Then
               m_tipe_codigo = value
               OnTIPE_CodigoChanged(m_tipe_codigo, EventArgs.Empty)
            End If
         Else
            m_tipe_codigo = value
            OnTIPE_CodigoChanged(m_tipe_codigo, EventArgs.Empty)
         End If
      End Set
   End Property
   Public Property TIPE_Desc() As String
      Get
         Return m_tipe_desc
      End Get
      Set(ByVal value As String)
         If Not IsNothing(m_tipe_desc) Then
            If Not m_tipe_desc.Equals(value) Then
               m_tipe_desc = value
               OnTIPE_DescChanged(m_tipe_desc, EventArgs.Empty)
            End If
         Else
            m_tipe_desc = value
            OnTIPE_DescChanged(m_tipe_desc, EventArgs.Empty)
         End If
      End Set
   End Property
   Public ReadOnly Property Nuevo() As Boolean
      Get
         Return m_nuevo
      End Get
   End Property
   Public ReadOnly Property Modificado() As Boolean
      Get
         Return m_modificado
      End Get
   End Property
   Public ReadOnly Property Eliminado() As Boolean
      Get
         Return m_eliminado
      End Get
   End Property
#End Region

#Region " Eventos "
   Public Event TIPE_CodigoChanged As EventHandler
   Public Event TIPE_DescChanged As EventHandler
   Public Sub OnTIPE_CodigoChanged(ByVal sender As Object, ByVal e As EventArgs)
      ActualizarInstancia()
      RaiseEvent TIPE_CodigoChanged(sender, e)
   End Sub
   Public Sub OnTIPE_DescChanged(ByVal sender As Object, ByVal e As EventArgs)
      ActualizarInstancia()
      RaiseEvent TIPE_DescChanged(sender, e)
   End Sub
#End Region

#Region " Metodos "
   'Public Sub Instanciar(ByVal x_instancia As NSEInstancia)
   '   Select Case x_instancia
   '      Case NSEInstancia.Consulta
   '         m_nuevo = False
   '         m_modificado = False
   '         m_eliminado = False
   '      Case NSEInstancia.Nuevo
   '         m_nuevo = True
   '         m_modificado = False
   '         m_eliminado = False
   '      Case NSEInstancia.Modificado
   '         m_nuevo = False
   '         m_modificado = True
   '         m_eliminado = False
   '      Case NSEInstancia.Eliminado
   '         m_nuevo = False
   '         m_modificado = False
   '         m_eliminado = True
   '   End Select
   'End Sub
   Public Sub ActualizarInstancia()
      If Not Nuevo Then
         If Not Eliminado Then
            'Instanciar(NSEInstancia.Modificado)
         End If
      End If
   End Sub
#End Region


End Class
